const di = document.querySelector<HTMLDivElement>('#Loading .loading')

type TL = {
  loadings: number[],
  addloadings(): void
  removeloadings(): void
}
const Loading: TL = {
  loadings: [],
  addloadings() {
    this.loadings.push(0);
    if (!di) return
    di.style.display = 'block'
  },
  removeloadings() {
    this.loadings.pop();
    if (!di) return
    if (!this.loadings.length) {
      di.style.display = 'none'
    }
  }
}
export default Loading